UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q+WmbMD1pTeMKX/Gxg4kpvG+vxGanV7W4MfXleALR/U='
WHERE
key_id = 'ee9b6f877f9f9441b2699d8a5e370382cbd4eb6e012c9b53c86feb08cdb3297f'
AND (
token = 'q+WmbMD1pTeMKX/Gxg4kpvG+vxGanV7W4MfXleALR/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)