UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9NkDKIOvoXy9lZOMm1zoP80QbkseHuaje8r1vXpEyAE=' 
WHERE 
  key_id = '4ba5138362295d322f54edc2b59a17ba92f3f8e2628a898684273906ac3e37f5' 
  AND (
    token = '9NkDKIOvoXy9lZOMm1zoP80QbkseHuaje8r1vXpEyAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030