UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Z7rQg5/C295RHGiNNQTcyVx7j+Hno6MEjitVQpIyYQ='
WHERE
key_id = 'c9d1a5d4c90c34997ce49fab44d526967602646ffa83ba31b762dc8785a22fd3'
AND (
token = '5Z7rQg5/C295RHGiNNQTcyVx7j+Hno6MEjitVQpIyYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)