UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0r2ZZPCIWXHliZLq9WF5QQujHxPCW4236mbyY8us4wo='
WHERE
key_id = '802308d4934c1d2afb919122346b2216223971391616337324128738b02ed16f'
AND (
token = '0r2ZZPCIWXHliZLq9WF5QQujHxPCW4236mbyY8us4wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)