UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'icMY8ffGy3CNCVz/QB52BkRzc2voUayfg2TG3beHKVg='
WHERE
key_id = '63b154e998a0594598d04f409b4a323dec98848e4dd1d3091792a6b3617a5cbc'
AND (
token = 'icMY8ffGy3CNCVz/QB52BkRzc2voUayfg2TG3beHKVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)