UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EHhqn3cEW286lQ5GZGn/IXG75Zwl7BYi34PfyT+rlXs='
WHERE
key_id = '87ce0a482dd0b32c19c57d35908b72b0a569c00fdd97aa6beb13883757ac355f'
AND (
token = 'EHhqn3cEW286lQ5GZGn/IXG75Zwl7BYi34PfyT+rlXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)