UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxXF+OwXT1o3UiTqBcLr49u/3lTTwMy7hleqD7faze8='
WHERE
key_id = 'a34378cfe6f6853d15b97798fcbe07873093d06e59ec8fde51b6c5b9e5ea14cf'
AND (
token = 'GxXF+OwXT1o3UiTqBcLr49u/3lTTwMy7hleqD7faze8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)