UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eWJOE0hL+RZKXxccLl+rVnslWFPiOoNFXV9UPT06tBk=' 
WHERE 
  key_id = '2bbe1b492089f44a5a3bd4c2205ee5241a9d1373bb4a4be299fbe58033ab7980' 
  AND (
    token = 'eWJOE0hL+RZKXxccLl+rVnslWFPiOoNFXV9UPT06tBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054