UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fIGgXxzrp4QIlJ0uOt3WyKyHvdkF6VAdGXXmhEJAOok='
WHERE
key_id = '86c3dcad3cae0bb92701a80a72867cc5af0e8d6d11db335b5e0096cecaa0bcee'
AND (
token = 'fIGgXxzrp4QIlJ0uOt3WyKyHvdkF6VAdGXXmhEJAOok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)