UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xa+xr6alaOs4ORu4y9sQ0C8ndrqLKSBVMriDVyxZU9c='
WHERE
key_id = '71235198912a7c36c71390ef8020940399a2403667eaf628813f0ac8d6461bb3'
AND (
token = 'xa+xr6alaOs4ORu4y9sQ0C8ndrqLKSBVMriDVyxZU9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)