UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AmhtGGatOzuiaScYjJ8R9dmIiBXQ1wo/JnxRKgBvXeQ='
WHERE
key_id = '76577dcf25ca183cf9c7bf8c9f82f664ae026e687aa4da86e8728514bc14149d'
AND (
token = 'AmhtGGatOzuiaScYjJ8R9dmIiBXQ1wo/JnxRKgBvXeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)