UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2cUo04GDZGlHDheg3z38hn/uEuEwliOHIE3LlMkFmQs=' 
WHERE 
  key_id = '60c821dec401ea5fc0fcbc7b5a0223c3187fbab90dad763ff72f15407836d34d' 
  AND (
    token = '2cUo04GDZGlHDheg3z38hn/uEuEwliOHIE3LlMkFmQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043