UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIAHvYpMt/7yn8klm9JP5cIqOEYuHAoGMOxtbqMpusk='
WHERE
key_id = 'a4b64e0bf94e2848d2b4aa8ae3b91b86170be8af9a95da8e44c93afe0f7e11e6'
AND (
token = 'vIAHvYpMt/7yn8klm9JP5cIqOEYuHAoGMOxtbqMpusk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)