UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tWNHIhgFhP6euTi/0OchVpMmxyNeLL2RmEmcv7JUtxQ=' 
WHERE 
  key_id = 'c0602044eb5a2061cc8b2d570c9869d4adada51a653da25307b207f95bddb1a0' 
  AND (
    token = 'tWNHIhgFhP6euTi/0OchVpMmxyNeLL2RmEmcv7JUtxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027