UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YlheKX4osKl/sARMexWkYCW8AACwvi8QQHRr6AvzTOE='
WHERE
key_id = '9f31f5819bf32d676badd1a5a42a7dd65f595d4aa0bd87f9768fe80f291f4174'
AND (
token = 'YlheKX4osKl/sARMexWkYCW8AACwvi8QQHRr6AvzTOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)