UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGVYW8Sl0YRTxuLJhnrySh/UYfQHcmR3O6+CztOY1lQ='
WHERE
key_id = '01345d747a2ec66533c622a8310060f34b4fd9bf60bdc75596e1f64bf3aaf612'
AND (
token = 'fGVYW8Sl0YRTxuLJhnrySh/UYfQHcmR3O6+CztOY1lQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)