UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T3vkmwny7HE/SswaQbOaRwqpMilYr2YBpsoN4dIVdgE=' 
WHERE 
  key_id = '9d1d432c4f547fc89d112f94f9dba67f17ff7a41dbcebdfa26e1dbd02e6224fe' 
  AND (
    token = 'T3vkmwny7HE/SswaQbOaRwqpMilYr2YBpsoN4dIVdgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028