UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6BWr4ABBCStgd/+xqEwI5MzI8rBj7tSjyKf248pxt4Y=' 
WHERE 
  key_id = 'bbf4ec1d36f70d4d51caf44ad7cee875a3524564e47435d9935fb61e9d572aec' 
  AND (
    token = '6BWr4ABBCStgd/+xqEwI5MzI8rBj7tSjyKf248pxt4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022