UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'og2tlHa+Tf9HRzayc8WTCjtRAA6Ly4MAHrw/FUD85p8=' 
WHERE 
  key_id = '0edfe8555c43030c648f343cce67e6374286e02174f918ee57b95362f7fa04c3' 
  AND (
    token = 'og2tlHa+Tf9HRzayc8WTCjtRAA6Ly4MAHrw/FUD85p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019