UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lKYo1iwpJrHQKWofmvIHdCspkZeIfNCXRd8HP6IVX/U='
WHERE
key_id = '924dca8c8341e12ec7aed7c0a5caf8d2f4483ef8f7a6cecee2aa5d70281bbbf2'
AND (
token = 'lKYo1iwpJrHQKWofmvIHdCspkZeIfNCXRd8HP6IVX/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)