UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGE5FVfsmL4dDiwqcUwpXbsyKGsmdu+jKgZyWUdQ8iw='
WHERE
key_id = '47167bf1760b172d70e7090400eb235f0282a73cb70065d3439f6ab5bd7569b1'
AND (
token = 'sGE5FVfsmL4dDiwqcUwpXbsyKGsmdu+jKgZyWUdQ8iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)