UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDUEoa7KoJCUgMOguG/zelGrmV3VDzAPeWqHSDRjNCE=' 
WHERE 
  key_id = '68d49bb59a8ddcd9c0b3632b7285a601f8da8888ef944e22405df3910b240a9f' 
  AND (
    token = 'vDUEoa7KoJCUgMOguG/zelGrmV3VDzAPeWqHSDRjNCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028