UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZSaYMBNu0VMJB4OmDZp9A8Vq/mOL2VSGnxuUU2MN4c=' 
WHERE 
  key_id = 'c78aae11119a8453a56715c12a9ece1abeaa1f9624a1a751e56cd80a63f9a77c' 
  AND (
    token = 'lZSaYMBNu0VMJB4OmDZp9A8Vq/mOL2VSGnxuUU2MN4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027