UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'McoRTJTMFndbN8ezZ50Z1Wc7wnyWWKqaD87Am99TvrY=' 
WHERE 
  key_id = 'e5018d0aeef928b245b9df4b9b908e3d86d3afcb6594e5a22651e10cc37c9d39' 
  AND (
    token = 'McoRTJTMFndbN8ezZ50Z1Wc7wnyWWKqaD87Am99TvrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030