UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bvfF2uWEiTGX5D9GW8HuN+RTT3pfi0df0lmkFxHY2p8='
WHERE
key_id = '4c3a5a270f9b81e3e40c0f8cc62c4f787ee779b88ab58151dba57e799b3c5224'
AND (
token = 'bvfF2uWEiTGX5D9GW8HuN+RTT3pfi0df0lmkFxHY2p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)