UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ehUhNXOkylH/dmIq8KozHjlPMvqJsOrbXUng1e5UB8='
WHERE
key_id = '5df60e114cc72046e25e58e0ff57a0a4626ccbdff68dee6a01eff3ab2715e187'
AND (
token = '/ehUhNXOkylH/dmIq8KozHjlPMvqJsOrbXUng1e5UB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)