UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+hxN+7B8ht4GUlMQaWrA1w03DxXF5ofR2GYkKmPCkRo=' 
WHERE 
  key_id = 'aa9e869653c54c39e93c738a941c73f9380cf4c5f72f9bbe9dd7925f1c4d3646' 
  AND (
    token = '+hxN+7B8ht4GUlMQaWrA1w03DxXF5ofR2GYkKmPCkRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046