UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yUqM8celTH8XMf/rnubVWooqUWvQ/6GI/Ryb0P/scsc='
WHERE
key_id = '839d30dd5d0c3178c52b3864b6c5200d07d4a1c0470e5c33c60375b5b4a2b433'
AND (
token = 'yUqM8celTH8XMf/rnubVWooqUWvQ/6GI/Ryb0P/scsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)